<%--
  Created by IntelliJ IDEA.
  User: 黎日升
  Date: 2019/4/15
  Time: 20:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script>
        addEventListener("load", function () {
            setTimeout(hideURLbar, 0);
        }, false);

        function hideURLbar() {
            window.scrollTo(0, 1);
        }

        function change(){


            document.getElementById('b').innerHTML="<input type='text' name='postbox'id='b1' />";
            document.getElementById('c').innerHTML="<input type='text' name='fname'id='c1' />";
            document.getElementById('d').innerHTML="<input type='text' name='sname'id='d1' />";
            document.getElementById('e').innerHTML="<input type='text' name='departments'id='e1' />"
            document.getElementById('f').innerHTML="<input type='text' name='object'id='f1' />"
            document.getElementById('g').innerHTML="<input type='submit' onclick='submit()' value='提交'/>";
        }

        function submit(){
            var b=document.getElementById('b1').value;
            var c=document.getElementById('c1').value;
            var d=document.getElementById('d1').value;
            var e=document.getElementById('e1').value;
            var f=document.getElementById('f1').value;
            var h=<%=(String)session.getAttribute("username")%>
            var i="<%=(String)session.getAttribute("url")%>"
           // var d="login.jsp"
            var e="postbox="+b+"&fname="+c+"&sname="+d+"&department="+e+"&object="+f+"&username="+h+"&url="+i;
            window.location.href="/login/Edit?"+e;


        }

    </script>
    <!-- Custom Theme files -->
    <link href="css/bootstrap.css" type="text/css" rel="stylesheet" media="all">
    <link href="css/style.css" type="text/css" rel="stylesheet" media="all">
    <!-- font-awesome icons -->
    <link href="css/fontawesome-all.min.css" rel="stylesheet">
    <!-- //Custom Theme files -->
    <!-- online-fonts -->
    <link href="http://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400,600,700,900" rel="stylesheet">
    <!-- //online-fonts -->

</head>
<body style="background-image:url(images/timg.jpg); background-repeat:no-repeat; background-attachment:fixed; background-size:cover;">

<%@page import="first.ReandFileBean"%>
<%@page import="first.ConnectBean"%>
<jsp:useBean id="s1" class="first.ReandFileBean"/>
<jsp:useBean id="s2" class="first.ConnectBean"/>
<%

    String value=(String)session.getAttribute("usename");
    String value1=(String)session.getAttribute("username");
    String url=(String)session.getAttribute("url");


    String login1;
    if(value==null) {


        login1="登陆";%>
    <h1>你没有登陆,请您登陆</h1>

   <%  }
    else {
        login1 = "退出";
        value1=s2.Connect(value1);
        s1.Read(value1);
        String username =s1.getUsername();
        String postbox=s1.getPostbox();
        String fname=s1.getFname();
        String sname=s1.getSname();
        String department=s1.getDepartment();
        String object=s1.getObject();

        String pourl="images/";
        pourl=pourl+s1.getUrl();


   %>


<div class="sidenav">
    <div class="side_top" >
        <!--<img src="%=pourl%>" alt="news image" class="img-fluid navimg">-->
        <div>
        <!--<form action="/login/UploadFile" enctype="multipart/form-data" method ="post" >
            文件<input type="file" name="file"/><br/>
            <input type="submit" name="upload" value="上传" />
            <input type=hidden name=username value="<=session.getAttribute("username")%>"/>
        </form>-->
            <form action="/login/UploadFile" enctype="multipart/form-data" method ="post" >
                <div style="text-align:center;">
                    <div style="float: left;">
                        <input type=hidden name=username value="<%=session.getAttribute("username")%>"/>
                        <input type=hidden name=url value="<%=session.getAttribute("url")%>"/>
                        <input type="submit" value="上传头像" style="color:blue;border: none;background-color: #ded7d7;" >
                    </div>
                    <br>
                    <div>
                        <a href="" title="更换头像">
                        <label for="file">
                            <img src="<%=pourl%>" alt="" class="tx" onload='if (this.width>140 || this.height>226) if (this.width/this.height>140/226) this.width=140; else this.height=226;'>
                        </label>
                        <input style="opacity:0;width:0px;color: #ded7d7;" required="required" type="file" id="file" name="file" accept="image/*"><br>
                    </a>
                    </div>
                </div>

            </form>


        <h1> 个人留言 <br>长风破浪会有时<br>直挂云帆济沧海</h1>
    </div>
    </div>
    <!-- header -->
    <header>
        <div class="container-fluid px-lg-5 ">
            <nav class="mnu mx-auto">
                <label for="drop" class="toggle">Menu</label>
                <input type="checkbox" id="drop">
                <ul class="menu">
                   <!-- <li class="active"><a href="index.html">Home</a></li>-->
                    <li class="mt-sm-3"><a href="#about" class="scroll">个人信息</a></li>
                    <li class="mt-sm-3">
                        <form id="createPersonForm" action="<%=url%>" method="post">
                            <input type="submit" id="CreateRecord" value="<%=login1%>" />
                        </form>
                    </li>
                    <!--<li class="mt-sm-3"><a href="#gallery" class="scroll">Gallery</a></li>
                    <li class="mt-sm-3"><a href="#services" class="scroll">Services</a></li>
                    <li class="mt-sm-3"><a href="#news" class="scroll">News</a></li>
                    <li class="mt-sm-3"><a href="#contact" class="scroll">Contact</a></li>-->
                </ul>
            </nav>
        </div>
    </header>
</div>
<div class="main" id="about">
    <div class="banner-text-w3ls">
        <div class="container">
            <div class="mx-auto text-left">
                <h2>个人信息</h2>
                <br>

                <input type="submit" onclick="change()" value="编辑"/>
                <table border=0 >
                    <tr>
                        <td width="150px" >用户名</td>

                        <td  width="150px">邮箱</td>
                    </tr>
                    <tr>
                        <td  id="a" height="50px"><%=username%></td>

                        <td  id="b" height="50px"><%=postbox%></td>
                    </tr>
                    <tr>
                        <td >姓</td>

                        <td >名</td>
                    </tr>
                    <tr>
                        <td  id="c" height="50px"><%=fname%></td>

                        <td  id ="d"height="50px"><%=sname%></td>
                    </tr>
                    <tr>
                        <td  >院系</td>

                        <td  >专业</td>
                    </tr>
                    <tr>
                        <td id="e" height="50px"><%=department%></td>

                        <td id="f" height="50px"><%=object%></td>
                    </tr>
                    <tr id="g">

                    </tr>

                </table>


                <h2 class="w3_head mb-5">绑定的信息</h2>
                <table border=0 >
                    <tr>
                        <td width="150px" >手机号</td>

                        <td  width="150px">QQ</td>
                    </tr>
                    <tr>
                        <td height="50px"></td>

                        <td height="50px"></td>
                    </tr>
                    <tr>
                        <td >微信</td>

                        <td >steam</td>
                    </tr>
                    <tr>
                        <td height="50px"></td>

                        <td height="50px"></td>
                    </tr>


                </table>

            </div>
        </div>
    </div>

</div>
<%
    }
%>



</body>
</html>
